package com.longder.kindergarten.repository;

import com.longder.kindergarten.entity.po.Child;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface ChildRepository extends JpaRepository<Child,Long> {

    /**
     * 查询某班级下的所有学生
     */
    @Query("select c from Child c where c.classGrade.id = :classId")
    List<Child> listByClassId(@Param("classId")Long classId);
}
